home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / sound / ymdeltat.h < prev   
C/C++ Source or Header  |  1999-12-27  |  2KB  |  55 lines

  1. #ifndef __YMDELTAT_H_
  2. #define __YMDELTAT_H_
  3.  
  4. #define YM_DELTAT_SHIFT    (16)
  5.  
  6. /* adpcm type A and type B struct */
  7. typedef struct deltat_adpcm_state {
  8.     UINT8 *memory;
  9.     int memory_size;
  10.     double freqbase;
  11.     INT32 *output_pointer; /* pointer of output pointers */
  12.     int output_range;
  13.  
  14.     UINT8 reg[16];
  15.     UINT8 portstate,portcontrol;
  16.     int portshift;
  17.  
  18.     UINT8 flag;          /* port state        */
  19.     UINT8 flagMask;      /* arrived flag mask */
  20.     UINT8 now_data;
  21.     UINT32 now_addr;
  22.     UINT32 now_step;
  23.     UINT32 step;
  24.     UINT32 start;
  25.     UINT32 end;
  26.     UINT32 delta;
  27.     INT32 volume;
  28.     INT32 *pan;        /* &output_pointer[pan] */
  29.     INT32 /*adpcmm,*/ adpcmx, adpcmd;
  30.     INT32 adpcml;            /* hiro-shi!! */
  31.  
  32.     /* leveling and re-sampling state for DELTA-T */
  33.     INT32 volume_w_step;   /* volume with step rate */
  34.     INT32 next_leveling;   /* leveling value        */
  35.     INT32 sample_step;     /* step of re-sampling   */
  36.  
  37.     UINT8 arrivedFlag;    /* flag of arrived end address */
  38. }YM_DELTAT;
  39.  
  40. /* static state */
  41. extern UINT8 *ym_deltat_memory;       /* memory pointer */
  42.  
  43. /* before YM_DELTAT_ADPCM_CALC(YM_DELTAT *DELTAT); */
  44. #define YM_DELTAT_DECODE_PRESET(DELTAT) {ym_deltat_memory = DELTAT->memory;}
  45.  
  46. void YM_DELTAT_ADPCM_Write(YM_DELTAT *DELTAT,int r,int v);
  47. void YM_DELTAT_ADPCM_Reset(YM_DELTAT *DELTAT,int pan);
  48.  
  49. /* INLINE void YM_DELTAT_ADPCM_CALC(YM_DELTAT *DELTAT); */
  50. #define YM_INLINE_BLOCK
  51. #include "ymdeltat.c" /* include inline function section */
  52. #undef  YM_INLINE_BLOCK
  53.  
  54. #endif
  55.